function imeInit() {
    var a = document.createElement('script');
    a.src = ime_hosturl + "patch.php";
    a.id = "ime_patch110";
    document.body.appendChild(a);
    setTimeout("imeOverRequest(\"ime_patch110\")", 10000);
    if (ime_close == 1) {
        ime_getObj("ime_status").style.display = "block";
        ime_close = 0;
        return
    } else ime_close = 0;
    var b = navigator.userAgent.toLowerCase();
    try {
        if (external.max_version.indexOf("1.") == 0) {
            ime_is_maxthon1 = 1
        } else {
            ime_is_maxthon1 = 0
        }
    } catch(e) {
        ime_is_maxthon1 = 0
    }
    ime_is_safari = b.indexOf("safari") != -1;
    var c = b.indexOf("firefox") != -1;
    ime_is_ie = (b.indexOf("msie") != -1 && document.all);
    ime_agent_modify = b.indexOf("mozilla") == -1 && b.indexOf("opera") == -1 ? 1 : 0;
    ime_compatMode = document.compatMode != "CSS1Compat" && !c ? 0 : 1;
    if (ime_is_ie) ime_is_ie6 = b.indexOf("msie 6") != -1 ? 1 : 0;
    ime_is_opera = (b.indexOf('opera') != -1 && window.opera && document.getElementById);
    if (ime_is_ie6 || !ime_compatMode) {
        onscroll = imeIE6StatusScroll;
        var d = document.documentElement.scrollTop || document.body.scrollTop || 0
    }
    var ime_clientWidth = window.top.window.innerWidth ? window.top.window.innerWidth: document.documentElement.clientWidth || document.body.clientWidth;
    var f = window.top.window.innerHeight ? window.top.window.innerHeight: document.documentElement.clientHeight || document.body.clientHeight;
    if (f < 62) f = 82;
    h = document.createElement('div');
    h.id = 'ime_status';
    h.style.background = 'url("' + ime_hosturl + 'images/ime_bit.gif") no-repeat -0px -80px';
    h.style.padding = '0px';
    h.style.margin = '0px';
    h.style.filter = 'Alpha(Opacity=90)';
    h.style.fontSize = '14px';
    h.style.position = (ime_is_ie6 || !ime_compatMode) ? "absolute": "fixed";
    h.style.left = (ime_clientWidth - 156) + "px";
    h.style.top = (ime_is_ie6 || !ime_compatMode) ? (d + f - 62) + "px": (f - 62) + "px";
    h.style.width = '136px';
    h.style.height = '42px';
    h.style.textAlign = 'center';
    h.style.zIndex = 999998;
    h.style.display = 'block';
    h.style.opacity = "0.9";
    document.body.insertBefore(h, document.body.firstChild);
    var g = '<table width="100%" style="width:136px;border-collapse:separate;border-spacing:1px;text-align:center;background:transparent none repeat scroll 0% 0%;position:relative;height:42px;" onmouseover=ime_moveobj("ime_status") cellspacing="1" cellpadding="0" ><tr style="background:transparent none repeat scroll 0% 0%;"><td style="padding:0px;border:none;"><span id="ime_mode_ZH" class="ime_cloud_zh1" onmouseover="imeModeChange(1,1)" onmouseout="imeModeChange(1,2)" onclick="imeModeChange(1,0)" onmousedown="imeModeChange(1,3)" onmouseup="imeModeChange(1,1)" title="切换中/英文(Shift)"></span><span id="ime_mode_BJ" class="ime_cloud_bj1" onclick="imeModeChange(2,0)" onmouseover="imeModeChange(2,1)" onmouseout="imeModeChange(2,2)" onmousedown="imeModeChange(2,3)" onmouseup="imeModeChange(2,1)" title="全/半角(Shift+Space)"></span><span id="ime_mode_BD" class="ime_cloud_bd1" onclick="imeModeChange(3,0)" onmouseover="imeModeChange(3,1)" onmouseout="imeModeChange(3,2)" onmousedown="imeModeChange(3,3)" onmouseup="imeModeChange(3,1)" title="中/英文标点(Ctrl+.)"></span><span id="ime_mode_close" class="ime_cloud_cl1" onclick="imeClose();" onmouseover="imeModeChange(4,1)" onmouseout="imeModeChange(4,2)" onmousedown="imeModeChange(4,3)" onmouseup="imeModeChange(4,1)"></span></td></tr></table>';
    ime_getObj("ime_status").innerHTML = g;
    var h = document.createElement('div');
    h.id = 'ime_layer';
    h.style.position = "absolute";
    h.style.display = 'none';
    h.style.padding = '0px';
    h.style.margin = '0px';
    h.style.height = '53px';
    h.style.zIndex = 999999;
    h.style.backgroundColor = '#FFF';
    h.style.filter = 'Alpha(Opacity=90)';
    h.style.display = 'none';
    h.style.opacity = "0.9";
    g = '<table id="layer_tab" onmouseover=ime_moveobj("ime_layer") width="' + tab_len + 'px" style="width:' + tab_len + 'px;margin:0px;color:#004376;font-weight:bold;position:relative;line-height:26px;" cellspacing="0" cellpadding="0" border="0">';
    g += '<tr style="vertical-align:middle;height:27px;"><td rowspan="2" width="1" style="background:url(' + ime_hosturl + 'images/ime_bit.gif) no-repeat -136px -53px;padding:0px;border:none;"></td><td id="ime_query" style="background:url(' + ime_hosturl + 'images/layer_top.gif) repeat-x;padding:0px 0px 0px 5px;font-size:16px;color:#004376;font-weight:bold;font-family:宋体,Arial;vertical-align:middle;border:none;" align=left height="27"></td><td width="51" rowspan="2" style="background:url(' + ime_hosturl + 'images/ime_bit.gif) no-repeat -120px -0px;padding:0px 0px 8px 0px;position:relative;border:none;" valign=bottom><a style="font-size:12px;color:#0082E5;display:block;position:absolute;top:0px;right:25px;line-height:26px;font-weight:normal;" href="http://code.google.com/p/fiskercloudinput/">项目</a><span class="ime_cloud_back1" id="ime_back" onmouseover="imeMouseOverPage(0);" onmouseout="imeMouseOutPage(0);" onmousedown="imePageRun(0,event)" onmouseup="imePageStop(0)"></span><span class="ime_cloud_forward1" id="ime_forward" onmouseover="imeMouseOverPage(1);" onmouseout="imeMouseOutPage(1);" onmousedown="imePageRun(1,event)" onmouseup="imePageStop(1)"></span></td></tr><tr style="vertical-align:middle;"><td height="26" style="padding:0px 0px 0px 5px;font-weight:normal;background:url(' + ime_hosturl + 'images/layer_bottom.gif) repeat-x;font-size:16px;cursor:default;font-family: 宋体;vertical-align:middle;letter-spacing:0;border:none;" align=left id="ime_res"></td></tr></table>';
    h.innerHTML = g;
    document.body.insertBefore(h, document.body.firstChild);
    g = '.ime_cloud_zh1,.ime_cloud_zh2,.ime_cloud_zh3,.ime_cloud_en1,.ime_cloud_en2,.ime_cloud_en3,.ime_cloud_bj1,.ime_cloud_bj2,.ime_cloud_bj3,.ime_cloud_qj1,.ime_cloud_qj2,.ime_cloud_qj3,.ime_cloud_bd1,.ime_cloud_bd2,.ime_cloud_bd3,.ime_cloud_be1,.ime_cloud_be2,.ime_cloud_be3,.ime_cloud_cl1,.ime_cloud_cl2,.ime_cloud_cl3{border:0;position:absolute;padding:0px;cursor:pointer;width:20px;height:20px;background:url(' + ime_hosturl + 'images/ime_bit.gif) no-repeat;}';
    g += '.ime_cloud_back1,.ime_cloud_back2,.ime_cloud_back3,.ime_cloud_forward1,.ime_cloud_forward2,.ime_cloud_forward3{border:0;display:block;position:absolute;top:34px;right:4px;margin:0px;padding:0px;background:url(' + ime_hosturl + 'images/ime_bit.gif) no-repeat;width:8px;height:12px;}';
    g += '.ime_cloud_back1,.ime_cloud_back2,.ime_cloud_back3{top:34px;right:15px;}';
    g += '.ime_cloud_forward1,.ime_cloud_forward2,.ime_cloud_forward3{top:34px;right:4px;}';
    g += '.ime_cloud_back1{background-position:-60px -60px;cursor:default;}';
    g += '.ime_cloud_back2{background-position:-68px -60px;cursor:pointer;}';
    g += '.ime_cloud_back3{background-position:-76px -60px;cursor:pointer;}';
    g += '.ime_cloud_forward1{background-position:-84px -60px;cursor:default;}';
    g += '.ime_cloud_forward2{background-position:-92px -60px;cursor:pointer;}';
    g += '.ime_cloud_forward3{background-position:-100px -60px;cursor:pointer;}';
    g += '.ime_cloud_zh1,.ime_cloud_zh2,.ime_cloud_zh3,.ime_cloud_en1,.ime_cloud_en2,.ime_cloud_en3{top:2px;left:50px;}';
    g += '.ime_cloud_bj1,.ime_cloud_bj2,.ime_cloud_bj3,.ime_cloud_qj1,.ime_cloud_qj2,.ime_cloud_qj3{top:2px;left:70px;}';
    g += '.ime_cloud_bd1,.ime_cloud_bd2,.ime_cloud_bd3,.ime_cloud_be1,.ime_cloud_be2,.ime_cloud_be3{top:2px;left:90px;}';
    g += '.ime_cloud_cl1,.ime_cloud_cl2,.ime_cloud_cl3{top:2px;left:110px;}';
    g += '.ime_cloud_zh1{background-position:-0px -20px;}';
    g += '.ime_cloud_zh2{background-position:-20px -20px;}';
    g += '.ime_cloud_zh3{background-position:-40px -20px;}';
    g += '.ime_cloud_en1{background-position:-0px -40px;}';
    g += '.ime_cloud_en2{background-position:-20px -40px;}';
    g += '.ime_cloud_en3{background-position:-40px -40px;}';
    g += '.ime_cloud_bj1{background-position:-60px -0px;}';
    g += '.ime_cloud_bj2{background-position:-80px -0px;}';
    g += '.ime_cloud_bj3{background-position:-100px -0px;}';
    g += '.ime_cloud_qj1{background-position:-0px -0px;}';
    g += '.ime_cloud_qj2{background-position:-20px -0px;}';
    g += '.ime_cloud_qj3{background-position:-40px -0px;}';
    g += '.ime_cloud_bd1{background-position:-60px -20px;}';
    g += '.ime_cloud_bd2{background-position:-80px -20px;}';
    g += '.ime_cloud_bd3{background-position:-100px -20px;}';
    g += '.ime_cloud_be1{background-position:-60px -40px;}';
    g += '.ime_cloud_be2{background-position:-80px -40px;}';
    g += '.ime_cloud_be3{background-position:-100px -40px;}';
    g += '.ime_cloud_cl1{background-position:-0px -60px;}';
    g += '.ime_cloud_cl2{background-position:-20px -60px;}';
    g += '.ime_cloud_cl3{background-position:-40px -60px;}';
    g += '#ime_layer *{margin:0px;padding:0px;}';
    g += '#ime_status *{margin:0px;padding:0px;}';
    try {
        var h = document.createStyleSheet();
        h.cssText = g
    } catch(e) {
        var h = document.createElement('style');
        h.type = "text/css";
        h.textContent = g;
        document.getElementsByTagName("HEAD").item(0).appendChild(h)
    }
    imeBindInput(document)
}
function imeFeedBack() {
    window.open("http://pinyin.sogou.com/fb/fillsurvey.php?sid=67&query=" + encodeURIComponent(query) + "&querylist=" + encodeURIComponent(word) + "&ref=" + encodeURIComponent(location.href), "_0")
}
function imePingBack() {
    var t = ime_pingback_showres;
    var a = document.createElement('img');
    a.src = "http://web.pinyin.sogou.com/cloud_inputtime.gif?t=" + t + "&q=" + query + "&src=" + encodeURIComponent(location.href) + "&n=" + Math.round(Math.random() * 10000000)
}
function imeIE6StatusScroll() {
    if (ime_close) return;
    var a = document.documentElement.scrollTop || document.body.scrollTop || 0;
    eval('document.getElementById("ime_status").style.top = "' + (a + ime_ie6_status_top) + 'px";')
}
function ime_getObj(a) {
    if (document.getElementById) return document.getElementById(a);
    else if (document.all) return document.all[a];
    else if (document.layers) return document.layers[a];
    else {
        return null
    }
}
function imeBindInput(a) {
    try {
        var b = a.getElementsByTagName('input');
        for (var i = 0; i < b.length; i++) {
            if (b[i].type == "text" && b[i].imebind == undefined) {
                b[i].imebind = true;
                b[i].onkeyup = null;
                b[i].onkeypress = null;
                if (document.addEventListener) {
                    b[i].addEventListener("keyup", imeInput, true);
                    b[i].addEventListener("keydown", imeKeyDown, true);
                    b[i].addEventListener("keypress", imeKeyPress, true)
                } else if (document.attachEvent) {
                    b[i].detachEvent("onkeyup", b[i].onkeyup);
                    b[i].detachEvent("onkeypress", b[i].onkeypress);
                    b[i].attachEvent("onkeyup", imeInput);
                    b[i].attachEvent("onkeydown", imeKeyDown);
                    b[i].attachEvent("onkeypress", imeKeyPress)
                } else {
                    var c = (b[i].onkeyup) ? b[i].onkeyup: function() {};
                    b[i].onkeyup = function() {
                        c();
                        imeInput()
                    };
                    var d = (b[i].onkeydown) ? b[i].onkeydown: function() {};
                    b[i].onkeydown = function() {
                        d();
                        imeKeyDown()
                    };
                    var f = (b[i].onkeypress) ? b[i].onkeypress: function() {};
                    b[i].onkeypress = function() {
                        f();
                        imeKeyPress()
                    }
                }
            }
        }
        var g = a.getElementsByTagName('textarea');
        for (var i = 0; i < g.length; i++) {
            if (g[i].imebind == undefined) {
                g[i].imebind = true;
                g[i].onkeyup = null;
                g[i].onkeypress = null;
                if (document.addEventListener) {
                    g[i].addEventListener("keyup", imeInput, true);
                    g[i].addEventListener("keydown", imeKeyDown, true);
                    g[i].addEventListener("keypress", imeKeyPress, true)
                } else if (document.attachEvent) {
                    g[i].detachEvent("onkeyup", g[i].onkeyup);
                    g[i].detachEvent("onkeypress", g[i].onkeypress);
                    g[i].attachEvent("onkeyup", imeInput);
                    g[i].attachEvent("onkeydown", imeKeyDown);
                    g[i].attachEvent("onkeypress", imeKeyPress)
                } else {
                    var c = (g[i].onkeyup) ? g[i].onkeyup: function() {};
                    g[i].onkeyup = function() {
                        c();
                        imeInput()
                    };
                    var d = (g[i].onkeydown) ? g[i].onkeydown: function() {};
                    g[i].onkeydown = function() {
                        d();
                        imeKeyDown()
                    };
                    var f = (g[i].onkeypress) ? g[i].onkeypress: function() {};
                    g[i].onkeypress = function() {
                        f();
                        imeKeyPress()
                    }
                }
            }
        }
        if (a.addEventListener) {
            try {
                a.removeEventListener("keydown", imeBodyKeyDown, true);
                a.removeEventListener("mousedown", imeBodyMouseDown, true);
                a.removeEventListener("activate", imeBodyActive, true)
            } catch(e) {}
            a.addEventListener("keydown", imeBodyKeyDown, true);
            a.addEventListener("mousedown", imeBodyMouseDown, true);
            if (location.href.indexOf(".google.com") != -1 || location.href.indexOf("126.com") != -1 || location.href.indexOf("web.qq.com") != -1 || location.href.indexOf("mail.live.com") != -1 || location.href.indexOf(".hotmail.com") != -1 || location.href.indexOf(".xici.net") != -1) a.addEventListener("DOMSubtreeModified", imeReBind, false);
            else a.addEventListener("DOMNodeInserted", imeReBind, false)
        } else if (a.attachEvent) {
            try {
                a.detachEvent("onkeydown", imeBodyKeyDown);
                a.detachEvent("onmousedown", imeBodyMouseDown);
                a.detachEvent("onactivate", imeBodyActive)
            } catch(e) {}
            a.attachEvent("onkeydown", imeBodyKeyDown);
            a.attachEvent("onmousedown", imeBodyMouseDown);
            a.attachEvent("onactivate", imeBodyActive)
        } else {
            var l = (a.onmousedown) ? a.onmousedown: function() {};
            a.onmousedown = function() {
                l();
                imeBodyMouseDown()
            }
        }
        var m = a.getElementsByTagName('iframe');
        for (var i = 0; i < m.length; i++) {
            try {
                if (m[i].contentDocument) {
                    var a = m[i];
                    a.imebind = true;
                    var o = a.contentDocument;
                    if (o.imebind == undefined) {
                        if ((o.designMode.toLowerCase() == "on" || o.body.contentEditable == "true")) {
                            a.design = true;
                            imeBindObj(o, "DESIGN")
                        } else imeBindInput(o);
                        ime_iframe_arr.push(a)
                    }
                } else if (m[i].contentWindow.document) {
                    var a = m[i];
                    a.imebind = true;
                    var o = a.contentWindow.document;
                    if (o.imebind == undefined) {
                        if ((o.designMode.toLowerCase() == "on" || o.body.contentEditable == "true")) {
                            a.design = true;
                            imeBindObj(o, "DESIGN")
                        } else imeBindInput(o);
                        ime_iframe_arr.push(a)
                    }
                }
            } catch(e) {}
        }
    } catch(e) {}
}
function imeReBind(e) {
    if (location.href.indexOf(".google.com") != -1 || location.href.indexOf("126.com") != -1 || location.href.indexOf("web.qq.com") != -1 || location.href.indexOf("mail.live.com") != -1 || location.href.indexOf(".hotmail.com") != -1 || location.href.indexOf(".xici.net") != -1) {
        if (ime_close) return
    } else {
        if (ime_close || !ime_detect) return
    }
    if (!ime_rebind_flag) return;
    if (ime_rebind_flag && ime_rebind_num == 0) {
        ime_rebind_flag = false;
        ime_rebind_num = 1;
        if (location.href.indexOf(".google.com") != -1 || location.href.indexOf("126.com") != -1 || location.href.indexOf("web.qq.com") != -1 || location.href.indexOf("mail.live.com") != -1 || location.href.indexOf(".hotmail.com") != -1 || location.href.indexOf(".xici.net") != -1) setTimeout(function() {
            ime_rebind_flag = true;
            me_rebind_num = 1;
            imeReBind();
            ime_rebind_flag = true;
            ime_rebind_num = 0
        },
        1200);
        else setTimeout(function() {
            ime_rebind_flag = true;
            me_rebind_num = 1;
            imeReBind();
            ime_rebind_flag = true;
            ime_rebind_num = 0
        },
        1200)
    }
    var a = document.getElementsByTagName('iframe');
    for (var i = 0; i < a.length; i++) {
        try {
            if (a[i].contentDocument) {
                var b = a[i];
                var c = b.contentDocument;
                c.imebind = true;
                if ((c.designMode.toLowerCase() == "on" || c.body.contentEditable == "true")) {
                    c.design = true;
                    imeBindObj(c, "DESIGN")
                } else imeBindInput(c);
                ime_iframe_arr.push(b)
            }
        } catch(e) {}
    }
    imeReBindTopElements(document)
}
function imeReBindTopElements(a) {
    var b = a.getElementsByTagName('input');
    for (var i = 0; i < b.length; i++) {
        if (b[i].type == "text" && b[i].imebind == undefined) {
            b[i].imebind = true;
            b[i].onkeyup = null;
            b[i].onkeypress = null;
            if (document.addEventListener) {
                b[i].addEventListener("keyup", imeInput, true);
                b[i].addEventListener("keydown", imeKeyDown, true);
                b[i].addEventListener("keypress", imeKeyPress, true);
                b[i].addEventListener("focus", fixImeStatus, true)
            }
        }
    }
    var c = a.getElementsByTagName('textarea');
    for (var i = 0; i < c.length; i++) {
        c[i].imebind = true;
        c[i].onkeyup = null;
        c[i].onkeypress = null;
        if (document.addEventListener) {
            c[i].addEventListener("keyup", imeInput, true);
            c[i].addEventListener("keydown", imeKeyDown, true);
            c[i].addEventListener("keypress", imeKeyPress, true);
            c[i].addEventListener("focus", fixImeStatus, true)
        }
    }
}
function imeBodyActive(e) {
    var a = e.srcElement;
    try {
        if (a.contentWindow.document.imebind == undefined && a.tagName == "IFRAME") {
            ime_iframe_arr.push(a);
            var b = a.contentWindow.document;
            if ((b.designMode.toLowerCase() == "on" || b.body.contentEditable == "true")) {
                a.design = true;
                imeBindObj(b, "DESIGN")
            } else imeBindInput(b)
        }
    } catch(e) {}
    setTimeout("imeBindInput(document)", 2000);
    setTimeout("imeBindInput(document)", 5000);
    setTimeout("imeBindInput(document)", 10000);
    setTimeout("imeBindInput(document)", 20000)
}
function imeBindObj(a, b) {
    if (b == "INPUT" || b == "TEXTAREA" || b == "DESIGN") {
        a.imebind = true;
        a.onkeyup = null;
        a.onkeypress = null;
        if (document.addEventListener) {
            a.addEventListener("keyup", imeInput, true);
            a.addEventListener("keydown", imeKeyDown, true);
            a.addEventListener("keypress", imeKeyPress, true)
        } else if (document.attachEvent) {
            a.detachEvent("onkeyup", a.onkeyup);
            a.detachEvent("onkeypress", a.onkeypress);
            a.attachEvent("onkeyup", imeInput);
            a.attachEvent("onkeydown", imeKeyDown);
            a.attachEvent("onkeypress", imeKeyPress)
        } else {
            var c = (a.onkeyup) ? a.onkeyup: function() {};
            a.onkeyup = function() {
                c();
                imeInput()
            };
            var d = (a.onkeydown) ? a.onkeydown: function() {};
            a.onkeydown = function() {
                d();
                imeKeyDown()
            };
            var e = (a.onkeypress) ? a.onkeypress: function() {};
            a.onkeypress = function() {
                e();
                imeKeyPress()
            }
        }
    }
}
function imeBlur(e) {
    if (ime_close) return;
    try {
        rng = ime_cur_rng;
        rng.moveStart("character", -e.srcElement.value.length);
        ime_cur_cursor = rng.text.length
    } catch(e) {}
}
function imeKeyPress(e) {
    ime_detect = false;
    if (ime_close) return;
    if (ime_fn_allow) return true;
    else if (!ime_opera_allow_press && ime_is_opera) e.preventDefault();
    else if (!ime_opera_allow_press && ime_is_ie) e.returnValue = false;
    else if (!ime_opera_allow_press && (ime_is_safari || ime_agent_modify)) e.preventDefault();
    var e = window.event || e;
    var a = e.which ? e.which: e.keyCode;
    if (e.ctrlKey && a != 190) return;
    var b = e.srcElement ? e.srcElement: e.target;
    if (a >= 65 && a <= 90) var c = true;
    else if (a >= 97 && a <= 122) {
        a -= 32;
        var c = false
    }
    if (a >= 65 && a <= 90) {
        if (!ime_mode_ZH) {
            if (!ime_is_ie && !ime_is_safari) e.preventDefault();
            imeOutput(b, 0, getModeInput(a, e.shiftKey || c));
            if (ime_is_maxthon1) e.returnValue = false;
            return
        }
        if ((e.shiftKey || c) && query == "") {
            if (!ime_is_ie && !ime_is_safari) e.preventDefault();
            imeOutput(b, 0, ime_mode_BJ ? keyArr[a][3] : keyArr[a][4]);
            if (ime_is_maxthon1) e.returnValue = false;
            return
        }
        if (e.shiftKey || c) input = keyArr[a][3];
        else input = keyArr[a][0];
        query += input;
        ime_query_input += input;
        var f = ime_getObj('ime_layer');
        var g = ime_getObj('ime_query');
        if (ime_query_input.length >= 100) {
            var h = ime_query_input;
            for (var i = 0; i < ime_part_key.length; i++) h = h.replace(ime_part_key[i], "");
            if (h.length >= 100) {
                ime_query_input = ime_query_input.substring(0, ime_query_input.length - 1);
                query = query.substring(0, query.length - 1)
            }
        }
        g.innerHTML = ime_query_input;
        with(ime_pos(b)) {
            layer_x = x;
            layer_y = y
        }
        if (layer_x != old_x || layer_y != old_y) {
            f.style.left = (layer_x + 10) + "px";
            scrollTop = document.documentElement.scrollTop || document.body.scrollTop || 0;
            clientHeight = document.documentElement.clientHeight || document.body.clientHeight || 0;
            if (clientHeight == 0) f.style.top = (layer_y + b.clientHeight + 3) + "px";
            else if ((layer_y + b.clientHeight + 56) > (clientHeight + scrollTop)) f.style.top = (layer_y - 53) + "px";
            else f.style.top = (layer_y + b.clientHeight + 3) + "px";
            old_x = layer_x;
            old_y = layer_y
        }
        f.style.display = query == "" ? "none": "block";
        if (query == "") {
            ime_getObj("ime_res").innerHTML = "";
            ime_getObj("layer_tab").style.width = tab_len + "px"
        } else {
            ime_getObj("ime_query").innerHTML += '<span style="position:absolute;top:1px;background:url(' + ime_hosturl + 'images/ime_bit.gif) no-repeat -120px -53px;width:1px;height:22px;">'
        }
        var j = 0;
        for (var i = 0; i < ime_part_key.length; i++) {
            j += ime_part_key[i][0].length
        }
        j += (query.length / 2);
        j = 184 + j * 16;
        if (j > tab_len) {
            ime_getObj("layer_tab").style.width = j + "px";
            tab_len = j
        }
    }
}
function imeOperaKeyChange(a) {
    if (a == 61) return 187;
    else if (a == 47) return 111;
    else if (a == 42) return 106;
    else if (a == 43) return 107;
    else if (a == 45) return 109;
    else return a
}
function imeBodyKeyDown(e) {
    if (ime_close) return;
    var e = window.event || e;
    var a = e.which ? e.which: e.keyCode;
    switch (a) {
    case 27:
        if (query != "") {
            query = "";
            ime_query_input = "";
            ime_part_key = new Array;
            word = new Array;
            ime_getObj('ime_res').innerHTML = "";
            ime_getObj("ime_layer").style.display = "none"
        } else return;
        break
    }
}
function imeBodyMouseDown(e) {
    if (ime_close) return;
    var e = window.event || e;
    var a = e.which ? e.which: e.keyCode;
    var b = e.srcElement ? e.srcElement: e.target;
    if (!b.imebind) {
        if (b.tagName == "INPUT" && b.type == "text") imeBindObj(b, "INPUT");
        else if (b.tagName == "TEXTAREA") imeBindObj(b, "TEXTAREA");
        else if ((b.tagName == "HTML" || b.tagName == "BODY") && (b.ownerDocument.designMode.toLowerCase() == "on" || b.ownerDocument.designMode.toLowerCase() == "true")) {
            imeBindObj(b, "DESIGN")
        }
    }
}
function imeKeyDown(e) {
    if (ime_close) return;
    imeMouseStopChange(e);
    var e = window.event || e;
    var a = e.srcElement ? e.srcElement: e.target;
    ime_cur_input_obj = a;
    if (!e) e = window.event;
    var b = e.which ? e.which: e.keyCode;
    if (e.ctrlKey && b != 190) return;
    ime_opera_allow_press = ime_fn_allow = 0;
    if (ime_is_opera) b = imeOperaKeyChange(b);
    ime_only_shift = b == 16 ? 1 : 0;
    var c = "";
    if (((b == 67 || b == 86) && e.ctrlKey) || (b <= 123 && b >= 112) || b == 35 || b == 36 || ((b == 33 || b == 34) && query == "") || b == 46 || b == 9) {
        ime_fn_allow = 1;
        return true
    }
    if (b == 224) ime_MacKey = 1;
    if (b == 84 && ime_MacKey) return true;
    switch (b) {
    case 46:
        return;
        break;
    case 27:
        if (query != "") {
            query = "";
            ime_query_input = "";
            ime_part_key = new Array
        } else {
            ime_opera_allow_press = 1;
            return
        }
        break;
    case 8:
        if (query != "") {
            if (ime_part_key.length) {
                var d = ime_part_key.pop();
                query = d[1] + query;
                ime_query_input = query;
                for (var i = ime_part_key.length; i > 0; i--) {
                    ime_query_input = ime_part_key[i - 1][0] + ime_query_input
                }
            } else {
                query = query.substr(0, query.length - 1);
                ime_query_input = query.replace(eval("/&/g"), "&")
            }
        } else {
            ime_opera_allow_press = 1;
            return
        }
        if (ime_is_ie || ime_is_safari) e.returnValue = false;
        break;
    case 13:
        if (query != "") {
            imeOutput(a, 0, -1);
            ime_query_input = "";
            query = "";
            c = "";
            ime_part_key = new Array;
            ime_getObj('ime_res').innerHTML = "";
            word = new Array;
            if (!ime_is_ie && !ime_is_safari) e.preventDefault();
            imeMouseStopChange(e);
            if (ime_is_ie) e.returnValue = false;
            else e.preventDefault()
        } else {
            ime_opera_allow_press = 1;
            return
        }
        break;
    case 32:
        if (e.shiftKey) {
            imeModeChange(2, 4);
            if (!ime_is_ie && !ime_is_safari) e.preventDefault();
            return false
        }
        if (query != "") {
            imeOutput(a, (focus_id - 1), "")
        } else {
            ime_opera_allow_press = 1;
            return
        }
        break;
    case 38:
        if (query != "") {
            if (ime_getObj("ime_res").innerHTML == "") {
                if (ime_is_ie) e.returnValue = false;
                else e.preventDefault();
                return false
            }
            if (focus_id > 1) {
                if (word[(focus_id - 2)][0] == "") return false;
                focus_id--
            } else {
                if (ime_query_page != 1) {
                    ime_query_page--;
                    imeShowRes(1);
                    focus_id = 5
                } else return false
            }
            focusChange(focus_id);
            return false
        } else {
            ime_opera_allow_press = 1;
            return
        }
        break;
    case 40:
        if (query != "") {
            if (ime_getObj("ime_res").innerHTML == "") {
                if (ime_is_ie) e.returnValue = false;
                else e.preventDefault();
                return false
            }
            if (focus_id < 5) {
                if (word[focus_id][0] == "") return false;
                focus_id++
            } else {
                if (ime_query_page < ime_query_page_max) {
                    ime_query_page++;
                    imeShowRes(1);
                    focus_id = 1
                } else {
                    imeChangePage(query, (Math.ceil((ime_query_page / 4))))
                }
            }
            focusChange(focus_id);
            return false
        } else {
            ime_opera_allow_press = 1;
            return
        }
        break;
    case 37:
        if (query == "") {
            ime_opera_allow_press = 1;
            return
        }
        break;
    case 39:
        if (query == "") {
            ime_opera_allow_press = 1;
            return
        }
        break;
    case 33:
        if (!ime_is_ie && !ime_is_safari) e.preventDefault();
        else e.returnValue = false;
        if (ime_query_page != 1) {
            ime_query_page--;
            imeShowRes(1)
        }
        break;
    case 188:
    case 109:
    case 189:
        var f = /[A-Z0-9`~@#%&*$+-=\^\{\}\|_]+/;
        if (f.test(query) || (query != "" && b == 109 && (ime_is_ie || ime_is_safari)) || (query != "" && e.shiftKey && (b == 109 || b == 188)) || (query != "" && e.shiftKey && b == 189 && (ime_is_ie || ime_is_opera || ime_is_safari))) {
            if (b == 188) {
                if (!ime_is_ie && !ime_is_safari) e.preventDefault();
                imeOutput(a, (focus_id - 1), getModeInput(b, e.shiftKey));
                break
            }
            c = !e.shiftKey ? keyArr[b][0] : keyArr[b][3];
            if (ime_is_ie) c = b == 109 ? "-": c;
            else if (ime_is_opera) c = b == 109 ? "_": c;
            query += c;
            ime_query_input += c;
            imeShowRes(0)
        } else if (query != "") {
            if (ime_query_page != 1) {
                ime_query_page--;
                imeShowRes(1)
            }
        } else imeOutput(a, 0, getModeInput(b, e.shiftKey));
        break;
    case 34:
        if (!ime_is_ie && !ime_is_safari) e.preventDefault();
        else e.returnValue = false;
        if (query != "") {
            if (ime_query_page < ime_query_page_max) {
                ime_query_page++;
                imeShowRes(1)
            } else {
                if (ime_query_page % 4 != 0) imePageNote(3, 0);
                else imeChangePage(query, (Math.ceil((ime_query_page / 4))))
            }
        }
        break;
    case 190:
        if (e.ctrlKey) {
            imeModeChange(3, 4);
            if (!ime_is_ie && !ime_is_safari) e.preventDefault();
            return
        }
    case 107:
    case 187:
        var f = /[A-Z0-9`~@#%&*$+-=\^\{\}\|_]+/;
        var h = /[@]+/;
        if (f.test(query) || (query != "" && b == 107 && (ime_is_ie || ime_is_opera || ime_is_safari)) || (query != "" && e.shiftKey && (b == 107 || b == 190)) || (query != "" && e.shiftKey && b == 187 && (ime_is_ie || ime_is_opera || ime_is_safari))) {
            if (b == 190) {
                if (!ime_is_ie && !ime_is_safari) e.preventDefault();
                imeOutput(a, (focus_id - 1), getModeInput(b, e.shiftKey));
                break
            }
            c = !e.shiftKey ? keyArr[b][0] : keyArr[b][3];
            c = b == 107 && (ime_is_ie || ime_is_opera || ime_is_safari) ? "+": c;
            query += c;
            ime_query_input += c;
            imeShowRes(0)
        } else if (query != "") {
            if (ime_query_page < ime_query_page_max) {
                ime_query_page++;
                imeShowRes(1)
            } else {
                if (ime_query_page % 4 != 0) imePageNote(3, 0);
                else imeChangePage(query, (Math.ceil((ime_query_page / 4))))
            }
        } else imeOutput(a, 0, getModeInput(b, e.shiftKey));
        break;
    case 192:
        if (e.shiftKey) {
            if (query == "") {
                if (ime_mode_BJ) imeOutput(a, 0, keyArr[b][3]);
                else imeOutput(a, 0, keyArr[b][4])
            } else {
                c = keyArr[b][3];
                query += c;
                ime_query_input += c
            }
        } else {
            if (query == "") {
                imeOutput(a, 0, getModeInput(b, e.shiftKey))
            } else {
                c = keyArr[b][0];
                query += c;
                ime_query_input += c
            }
        }
        if (!ime_is_ie && !ime_is_safari) e.preventDefault();
        break;
    case 220:
    case 219:
    case 221:
        if (e.shiftKey) {
            if (query == "") {
                imeOutput(a, 0, getModeInput(b, e.shiftKey));
                if (!ime_is_ie && !ime_is_safari) e.preventDefault()
            } else {
                c = keyArr[b][3];
                query += c;
                ime_query_input += c
            }
            break
        } else {
            imeOutput(a, (focus_id - 1), getModeInput(b, e.shiftKey));
            if (!ime_is_ie && !ime_is_safari) e.preventDefault();
            break
        }
    case 59:
    case 106:
    case 110:
    case 111:
    case 186:
    case 191:
    case 220:
        imeOutput(a, (focus_id - 1), getModeInput(b, e.shiftKey));
        if (!ime_is_ie && !ime_is_safari) e.preventDefault();
        break;
    case 222:
        var j = 0;
        if (ime_mode_BD) {
            if (e.shiftKey) {
                j = 4;
                j += ime_double_quote == 0 ? 2 : 3;
                ime_double_quote = ime_double_quote == 1 ? 0 : 1
            } else {
                j = 0;
                j += ime_single_quote == 0 ? 2 : 3;
                ime_single_quote = ime_single_quote == 1 ? 0 : 1
            }
            if (!imeOutput(a, (focus_id - 1), keyArr[222][j])) {
                if (e.shiftKey) ime_double_quote = ime_double_quote == 1 ? 0 : 1;
                else ime_single_quote = ime_single_quote == 1 ? 0 : 1
            }
        } else if (!ime_mode_BJ) {
            j = e.shiftKey ? 5 : 1;
            imeOutput(a, (focus_id - 1), keyArr[222][j])
        } else {
            j = e.shiftKey ? 4 : 0;
            imeOutput(a, (focus_id - 1), keyArr[222][j])
        }
        if (!ime_is_ie && !ime_is_safari) e.preventDefault();
        break;
    case 96:
    case 97:
    case 98:
    case 99:
    case 100:
    case 101:
    case 102:
    case 103:
    case 104:
    case 105:
        if (query == "") {
            if (ime_mode_BJ) {
                imeOutput(a, 0, keyArr[b][0]);
                if (!ime_is_ie && !ime_is_safari) e.preventDefault();
                return false
            } else {
                imeOutput(a, 0, keyArr[b][2]);
                if (!ime_is_ie && !ime_is_safari) e.preventDefault();
                return false
            }
        } else {
            c = keyArr[b][0];
            query += c;
            ime_query_input += c
        }
        break
    }
    if (b >= 48 && b <= 57) {
        if (e.shiftKey) {
            if ((b == 50) || (b == 51) || (b == 53) || (b == 55) || (b == 56) || (b == 52)) {
                if (query == "") {
                    if (b == 52) imeOutput(a, 0, getModeInput(b, e.shiftKey));
                    else imeOutput(a, 0, keyArr[b][3])
                } else {
                    c = keyArr[b][3];
                    query += c;
                    if (b == 55) ime_query_input += "&";
                    else ime_query_input += c
                }
            } else imeOutput(a, (focus_id - 1), getModeInput(b, e.shiftKey))
        } else {
            if (query == "") {
                if (ime_mode_BJ) {
                    imeOutput(a, 0, keyArr[b][0]);
                    if (!ime_is_ie && !ime_is_safari) e.preventDefault();
                    if (ime_is_maxthon1) e.returnValue = false;
                    return
                } else {
                    imeOutput(a, 0, keyArr[b][2]);
                    if (!ime_is_ie && !ime_is_safari) e.preventDefault();
                    if (ime_is_maxthon1) e.returnValue = false;
                    return
                }
            }
            c = keyArr[b][0];
            var f = /[A-Z0-9`~@#%&*$+-=\^\{\}\|_]+/;
            if (c > 0 && c < 6 && !f.test(query)) {
                imeOutput(a, --c, "")
            } else {
                query += c;
                ime_query_input += c
            }
        }
    }
    if (!ime_is_ie && !ime_is_safari && !ime_agent_modify) e.preventDefault();
    if (ime_is_maxthon1) e.returnValue = false;
    var l = ime_getObj('ime_layer');
    var m = ime_getObj('ime_query');
    if (ime_query_input.length >= 100) {
        var n = ime_query_input;
        for (var i = 0; i < ime_part_key.length; i++) n = n.replace(ime_part_key[i], "");
        if (n.length >= 100) {
            ime_query_input = ime_query_input.substring(0, ime_query_input.length - 1);
            query = query.substring(0, query.length - 1)
        }
    }
    m.innerHTML = ime_query_input;
    with(ime_pos(a)) {
        layer_x = x;
        layer_y = y
    }
    if (layer_x != old_x || layer_y != old_y) {
        l.style.left = (layer_x + 10) + "px";
        scrollTop = document.documentElement.scrollTop || document.body.scrollTop || 0;
        clientHeight = document.documentElement.clientHeight || document.body.clientHeight || 0;
        if (clientHeight == 0) l.style.top = (layer_y + a.clientHeight + 3) + "px";
        else if ((layer_y + a.clientHeight + 56) > (clientHeight + scrollTop)) l.style.top = (layer_y - 53) + "px";
        else l.style.top = (layer_y + a.clientHeight + 3) + "px";
        old_x = layer_x;
        old_y = layer_y
    }
    l.style.display = query == "" ? "none": "block";
    if (query == "") {
        ime_getObj("ime_res").innerHTML = "";
        ime_getObj("layer_tab").style.width = "334px"
    } else {
        ime_getObj("ime_query").innerHTML += '<span style="position:absolute;top:1px;background:url(' + ime_hosturl + 'images/ime_bit.gif) no-repeat -120px -53px;width:1px;height:22px;">'
    }
    var o = 0;
    for (var i = 0; i < ime_part_key.length; i++) {
        o += ime_part_key[i][0].length
    }
    o += (query.length / 2);
    o = 184 + o * 16;
    if (o > tab_len) {
        ime_getObj("layer_tab").style.width = o + "px";
        tab_len = o
    }
    return
}
function imeInsert(a, b) {
    var c = a.ownerDocument;
    if (ime_is_ie) {
        var d = c.selection.createRange();
        d.select();
        d.pasteHTML(b);
        d.collapse(false);
        d.select()
    } else c.execCommand("insertHTML", false, b)
}
function imeOutput(a, b, c) {
    if (a.tagName == "BODY" || a.tagName == "HTML") {
        if (query == "" || c == -1) {
            c = c == -1 ? ime_query_input.replace(eval("/&/g"), "&") : c;
            c = ime_mode_BJ ? c: imeToDBC(c);
            imeInsert(a, c);
            word = new Array;
            return true
        }
        if (ime_mode_ZH) {
            if (word.length != 6) return false;
            if (query != word[5][0]) return false
        }
        if (query.length == word[b][1] || c != "") {
            var d = "";
            var e = "";
            for (var i = 0; i < ime_part_key.length; i++) {
                e += ime_part_key[i][0]
            }
            c = c == -2 ? "": c;
            d = ime_mode_BJ ? e + word[b][0] + c: imeToDBC(e + word[b][0] + c);
            imeInsert(a, d);
            imePingBack();
            query = "";
            ime_query_input = "";
            ime_part_key = new Array;
            ime_getObj('ime_res').innerHTML = "";
            word = new Array;
            return true
        } else {
            ime_part_key.push(Array(word[b][0], query.substring(0, word[b][1])));
            query = query.substr(word[b][1]);
            ime_query_input = "";
            for (var i = 0; i < ime_part_key.length; i++) {
                ime_query_input += ime_part_key[i][0]
            }
            ime_query_input += query;
            return true
        }
    } else {
        var d = a.value != undefined ? a.value: a.innerHTML;
        if (query == "" || c == -1) {
            var g = imeGetCurSor(a).split("|");
            var h = g[1] != d.length ? 1 : 0;
            var c = c == -1 ? ime_query_input.replace(eval("/&/g"), "&") : c;
            if (ime_mode_BJ) d = d.substr(0, g[0]) + c + d.substr(g[1], d.length);
            else d = d.substr(0, g[0]) + imeToDBC(c) + d.substr(g[1], d.length);
            if (a.value != undefined) {
                a.value = d
            } else if (a.innerHTML != undefined) {
                a.innerHTML = d
            }
            if (h) {
                movePoint(a, parseInt(g[0]) + (c).length)
            } else movePoint(a, d.length);
            word = new Array;
            return true
        }
        if (ime_mode_ZH) {
            if (word.length != 6) return false;
            if (query != word[5][0]) return false
        }
        if (query.length == word[b][1] || c != "") {
            var e = "";
            for (var i = 0; i < ime_part_key.length; i++) {
                e += ime_part_key[i][0]
            }
            var g = imeGetCurSor(a).split("|");
            c = c == -2 ? "": c;
            var h = g[1] != d.length ? 1 : 0;
            if (ime_mode_BJ) d = d.substr(0, g[0]) + e + word[b][0] + c + d.substr(g[1], d.length);
            else d = d.substr(0, g[0]) + imeToDBC(e + word[b][0] + c) + d.substr(g[1], d.length);
            if (a.value != undefined) {
                a.value = d
            } else if (a.innerHTML != undefined) {
                a.innerHTML = d
            }
            if (h) movePoint(a, parseInt(g[0]) + (e + word[b][0] + c).length);
            else movePoint(a, d.length);
            imePingBack();
            query = "";
            ime_query_input = "";
            ime_part_key = new Array;
            ime_getObj('ime_res').innerHTML = "";
            word = new Array;
            return true
        } else {
            ime_part_key.push(Array(word[b][0], query.substring(0, word[b][1])));
            query = query.substr(word[b][1]);
            ime_query_input = "";
            for (var i = 0; i < ime_part_key.length; i++) {
                ime_query_input += ime_part_key[i][0]
            }
            ime_query_input += query;
            return true
        }
    }
    ime_detect = true
}
function imeMouseInput(n) {
    ime_cur_input_obj.focus();
    imeOutput(ime_cur_input_obj, n, "");
    var a = ime_getObj('ime_query');
    var b = ime_getObj('ime_layer');
    a.innerHTML = ime_query_input;
    b.style.display = query == "" ? "none": "block";
    if (query == "") {
        ime_getObj("ime_res").innerHTML = "";
        ime_getObj("layer_tab").style.width = "334px"
    }
    var c = 0;
    for (var i = 0; i < ime_part_key.length; i++) {
        c += ime_part_key[i][0].length
    }
    c += (query.length / 2);
    c = 184 + c * 16;
    if (c > tab_len) {
        ime_getObj("layer_tab").style.width = c + "px";
        tab_len = c
    }
    ime_query_page = 1;
    ime_query_page_max = 1;
    var d = /[A-Z0-9`~@#%&*$+-=\^\{\}\|_]+/;
    if (!d.test(query)) {
        ime_request_waiting = query;
        imeCreateRequest(query)
    } else {
        imeShowRes(0)
    }
}
function imeModeChange(a, b) {
    if (b == 0 || b == 4) {
        switch (a) {
        case 1:
            if (ime_mode_ZH && query != "") imeOutput(ime_cur_input_obj, 0, -1);
            if (b == 4) ime_getObj('ime_mode_ZH').className = ime_mode_ZH == 1 ? "ime_cloud_en1": "ime_cloud_zh1";
            else ime_getObj('ime_mode_ZH').className = ime_mode_ZH == 1 ? "ime_cloud_en2": "ime_cloud_zh1";
            ime_mode_ZH = ime_mode_ZH == 1 ? 0 : 1;
            ime_getObj('ime_mode_BD').className = ime_mode_ZH == 0 ? "ime_cloud_be1": "ime_cloud_bd1";
            ime_mode_BD = ime_mode_ZH == 1 ? 1 : 0;
            ime_getObj('ime_layer').style.display = "none";
            ime_getObj('ime_res').innerHTML = "";
            query = "";
            ime_query_input = "";
            break;
        case 2:
            if (b == 4) ime_getObj('ime_mode_BJ').className = ime_mode_BJ == 1 ? "ime_cloud_qj1": "ime_cloud_bj1";
            else ime_getObj('ime_mode_BJ').className = ime_mode_BJ == 1 ? "ime_cloud_qj2": "ime_cloud_bj2";
            ime_mode_BJ = ime_mode_BJ == 1 ? 0 : 1;
            break;
        case 3:
            if (b == 4) ime_getObj('ime_mode_BD').className = ime_mode_BD == 1 ? "ime_cloud_be1": "ime_cloud_bd1";
            else ime_getObj('ime_mode_BD').className = ime_mode_BD == 1 ? "ime_cloud_be2": "ime_cloud_bd2";
            ime_mode_BD = ime_mode_BD == 1 ? 0 : 1;
            ime_getObj('ime_mode_ZH').className = ime_mode_BD == 1 ? "ime_cloud_zh1": ime_getObj('ime_mode_ZH').className;
            ime_mode_ZH = ime_mode_BD == 1 ? 1 : ime_mode_ZH;
            break
        }
    } else if (b == 1) {
        switch (a) {
        case 1:
            ime_getObj('ime_mode_ZH').className = ime_mode_ZH == 0 ? "ime_cloud_en2": "ime_cloud_zh2";
            break;
        case 2:
            ime_getObj('ime_mode_BJ').className = ime_mode_BJ == 0 ? "ime_cloud_qj2": "ime_cloud_bj2";
            break;
        case 3:
            ime_getObj('ime_mode_BD').className = ime_mode_BD == 0 ? "ime_cloud_be2": "ime_cloud_bd2";
            break;
        case 4:
            ime_getObj('ime_mode_close').className = "ime_cloud_cl2";
            break
        }
    } else if (b == 2) {
        switch (a) {
        case 1:
            ime_getObj('ime_mode_ZH').className = ime_mode_ZH == 0 ? "ime_cloud_en1": "ime_cloud_zh1";
            break;
        case 2:
            ime_getObj('ime_mode_BJ').className = ime_mode_BJ == 0 ? "ime_cloud_qj1": "ime_cloud_bj1";
            break;
        case 3:
            ime_getObj('ime_mode_BD').className = ime_mode_BD == 0 ? "ime_cloud_be1": "ime_cloud_bd1";
            break;
        case 4:
            ime_getObj('ime_mode_close').className = "ime_cloud_cl1";
            break
        }
    } else if (b == 3) {
        switch (a) {
        case 1:
            ime_getObj('ime_mode_ZH').className = ime_mode_ZH == 0 ? "ime_cloud_en3": "ime_cloud_zh3";
            break;
        case 2:
            ime_getObj('ime_mode_BJ').className = ime_mode_BJ == 0 ? "ime_cloud_qj3": "ime_cloud_bj3";
            break;
        case 3:
            ime_getObj('ime_mode_BD').className = ime_mode_BD == 0 ? "ime_cloud_be3": "ime_cloud_bd3";
            break;
        case 4:
            ime_getObj('ime_mode_close').className = "ime_cloud_cl3";
            break
        }
    }
}
function imeInput(e) {
    if (ime_close) return;
    var e = window.event || e;
    var a = document.activeElement;
    var b = e.which ? e.which: e.keyCode;
    if (b == 16 && ime_only_shift) {
        imeModeChange(1, 4);
        ime_only_shift = 0
    }
    if (b == 224) ime_MacKey = 0;
    if ((query != "") && ((b >= 65 && b <= 90) || (b == 8) || (b == 13) || (b == 32) || (b == 192) || (b >= 219 && b <= 221) || (b >= 48 && b <= 57) || (b >= 96 && b <= 105))) {
        ime_query_page = 1;
        ime_query_page_max = 1;
        var c = /[A-Z0-9`~@#%&*$+-=\^\{\}\|_]+/;
        if (!c.test(query)) {
            ime_request_waiting = query;
            imeCreateRequest(query)
        } else {
            imeShowRes(0)
        }
    }
}
function imeChangePage(q, p) {
    if (ime_getObj("ime_forward").className != "ime_cloud_forward1") {
        var a = document.createElement('script');
        a.id = "ime_js_" + q + p;
        a.setAttribute("type", "text/javascript");
        a.src = "http://web.pinyin.sogou.com/api/py?key=" + ime_patch_key + "&query=" + q + "&p=" + p;
        ime_pingback_keyup = new Date().getTime();
        document.body.appendChild(a);
        setTimeout("imeOverRequest(\"ime_js_" + q + p + "\")", 10000)
    }
}
function imeCreateRequest(q, p) {
    if (ime_request_on) {
        var q = ime_request_waiting;
        ime_request_waiting = "";
        ime_request_on = 0;
        eval('ime_fetch_' + q + '=setTimeout("imeTimeOut()",100);');
        var a = document.createElement('script');
        a.id = "ime_js_" + q;
        a.setAttribute("type", "text/javascript");
        a.src = "http://web.pinyin.sogou.com/api/py?key=" + ime_patch_key + "&query=" + q;
        ime_pingback_keyup = new Date().getTime();
        document.body.appendChild(a);
        setTimeout("imeOverRequest(\"ime_js_" + q + "\")", 10000)
    }
}
function imeTimeOut() {
    ime_request_on = 1;
    if (ime_request_waiting != "") {
        imeCreateRequest(ime_request_waiting)
    }
}
function imeOverRequest(q) {
    try {
        var a = ime_getObj(q);
        document.body.removeChild(a)
    } catch(e) {}
}
function ime_callback(a, b, p) {
    var t = new Date().getTime();
    if (t > ime_pingback_keyup) ime_pingback_showres = t - ime_pingback_keyup;
    try {
        eval('clearTimeout(ime_fetch_' + b + ');')
    } catch(e) {}
    try {
        a = decodeURIComponent(a);
        b = decodeURIComponent(b)
    } catch(e) {}
    if (p == 0) {
        ime_request_on = 1;
        if (ime_request_waiting != "") {
            imeCreateRequest(ime_request_waiting)
        }
        if (query == b) {
            ime_query_res = a;
            ime_query_key = b;
            imeShowRes(1)
        }
    } else if (p > 0 && b == query && ime_query_res != -1) {
        if (ime_query_res.split("\t+").length <= p * 20 && a != "") {
            ime_query_res += "\t+" + a;
            ime_query_page++;
            imeShowRes(1)
        } else imePageNote(3, 0)
    }
}
function imeShowRes(a) {
    if (query == ime_query_key || !a) {
        var b = ime_query_key;
        if (ime_query_res == "" || !a) {
            ime_query_key = a ? ime_query_key: query;
            word = new Array(Array(ime_query_key, ime_query_key.length), Array(ime_query_key, ime_query_key.length), Array(ime_query_key, ime_query_key.length), Array(ime_query_key, ime_query_key.length), Array(ime_query_key, ime_query_key.length), Array(ime_query_key, ime_query_key.length));
            ime_query_res = -1;
            clearTimeout(ime_settime);
            ime_settime = -1;
            focus_id = 1;
            imePageNote(0, 0);
            ime_getObj("ime_res").innerHTML = "";
            var c = 0;
            for (var i = 0; i < ime_part_key.length; i++) {
                c += ime_part_key[i][0].length
            }
            tab_len = 334;
            c += (query.length / 2);
            c = 184 + c * 16 > tab_len ? 184 + c * 16 : tab_len;
            tab_len = c;
            ime_getObj("layer_tab").style.width = tab_len + "px";
            return
        }
        var d = ime_query_res.split("\t+");
        ime_query_page_max = Math.ceil(d.length * 1.0 / 5);
        if (a == 2 || a == 3) imePageNote(a, a);
        else imePageNote(1, 1);
        var c = 0;
        word = new Array;
        for (var i = 0,
        j = (ime_query_page - 1) * 5; j < d.length && j < ime_query_page * 5; i++, j++) {
            word[i] = d[j].split("：");
            c += word[i][0].length
        }
        while (word.length < 5) word.push(Array("", "0"));
        word[5] = Array(b, b.length);
        var f = 0;
        for (var i = 0; i < ime_part_key.length; i++) {
            f += ime_part_key[i][0].length
        }
        f += (query.length / 2);
        if (c < 10) c = 10;
        c = c > f ? c: f;
        c = 184 + c * 16;
        if ((a != 2 && a != 3) || parseInt(c) > parseInt(tab_len)) {
            ime_getObj("layer_tab").width = c + "px";
            tab_len = c
        }
        var g = "";
        for (var i = 0; i < 5; i++) {
            if (word[i][0]) {
                if (word[i][0] != "") {
                    if (i == 0) g += "<font id='ime_item_" + (i + 1) + "' onclick=\"imeMouseInput(" + i + ")\" style='color:#f00;cursor:pointer;font-size:16px;font-weight:normal;line-height:26px;'>" + eval(i + " + 1") + "." + word[i][0] + "</font> ";
                    else g += "<font id='ime_item_" + (i + 1) + "' onclick=\"imeMouseInput(" + i + ")\" style='color:#0082e5;cursor:pointer;font-size:16px;font-weight:normal;line-height:26px;'>" + eval(i + " + 1") + "." + word[i][0] + "</font> "
                }
            }
        }
        focus_id = 1;
        g += "\n";
        var h = ime_getObj("ime_res");
        ime_getObj("layer_tab").style.width = tab_len + "px";
        h.innerHTML = g;
        clearTimeout(ime_settime);
        ime_settime = -1
    }
}
function imeCancel(e) {
    var a = ime_getObj('ime_layer');
    a.style.display = "none"
}
function imePageNote(a, b) {
    if (ime_query_page != 1 && a) {
        ime_getObj("ime_back").className = a == 2 ? "ime_cloud_back3": "ime_cloud_back2";
        ime_getObj("ime_back").style.cursor = "pointer"
    } else {
        ime_getObj("ime_back").className = "ime_cloud_back1";
        ime_getObj("ime_back").style.cursor = "default"
    }
    if (b) {
        ime_getObj("ime_forward").className = b == 3 ? "ime_cloud_forward3": "ime_cloud_forward2";
        ime_getObj("ime_forward").style.cursor = "pointer"
    } else {
        ime_getObj("ime_forward").className = "ime_cloud_forward1";
        ime_getObj("ime_forward").style.cursor = "default"
    }
}
function imeMouseStopChange(e) {
    if (e && e.stopPropagation) {　　　　e.stopPropagation()
    } else {　　　　e.cancelBubble = true
    }
    return false
}
function imePageRun(a, e) {
    if (a == 0) ime_settime_page = setTimeout("imePageAuto(0)", 500);
    else if (a == 1) ime_settime_page = setTimeout("imePageAuto(1)", 500);
    imeMouseStopChange(e)
}
function imePageStop(a) {
    clearTimeout(ime_settime_page);
    if (a == 0 && ime_getObj("ime_back").className != "ime_cloud_back1") {
        ime_query_page--;
        imeShowRes(2)
    } else if (a == 1 && ime_getObj("ime_forward").className != "ime_cloud_forward1") {
        if (ime_query_page < ime_query_page_max) {
            ime_query_page++;
            imeShowRes(3)
        } else imeChangePage(query, (Math.ceil((ime_query_page / 4))))
    }
    ime_cur_input_obj.focus()
}
function imePageAuto(a) {
    if (a == 0 && ime_getObj("ime_back").className != "ime_cloud_back1") {
        ime_query_page--;
        imeShowRes(2);
        ime_settime_page = setTimeout("imePageAuto(0)", 300)
    } else if (a == 1 && ime_getObj("ime_forward").className != "ime_cloud_forward1") {
        if (ime_query_page < ime_query_page_max) {
            ime_query_page++;
            imeShowRes(3)
        } else imeChangePage(query, (Math.ceil((ime_query_page / 4))));
        ime_settime_page = setTimeout("imePageAuto(1)", 300)
    } else clearTimeout(ime_settime_page)
}
var ime_pos = function(o) {
    if (location.href.indexOf("mail.google") != -1 || location.href.indexOf("xici.net") != -1) {
        x = document.documentElement.scrollLeft || document.body.scrollLeft || 0 + 200;
        y = document.documentElement.scrollTop || document.body.scrollTop || 0 + 200;
        return {
            'x': x,
            'y': y
        }
    }
    try {
        var a = o;
        var x = 0,
        y = 0,
        n;
        do {
            x += o.offsetLeft, y += o.offsetTop;
            n = o;
            o = o.offsetParent
        } while ( o );
        if (n = n.ownerDocument) {
            if (n.URL != location.href) {
                for (var i = 0; i < ime_iframe_arr.length; i++) {
                    if (ime_iframe_arr[i].src.substring(0, 1) == "/") var b = "http://" + document.domain + ime_iframe_arr[i].src;
                    else if (ime_iframe_arr[i].src.substring(0, 2) == "./") var b = "http://" + document.domain + ime_iframe_arr[i].src.substring(1);
                    else var b = location.href.substring(0, location.href.lastIndexOf("/") + 1) + ime_iframe_arr[i].src;
                    if ((ime_iframe_arr[i].src == n.URL || b == n.URL) && ime_iframe_arr[i].src != "") {
                        o = ime_iframe_arr[i];
                        do {
                            x += o.offsetLeft, y += o.offsetTop
                        } while ( o = o . offsetParent );
                        break
                    }
                }
            }
        }
        if (x <= 10 && y <= 10) {
            x = document.documentElement.scrollLeft || document.body.scrollLeft || 0 + 200;
            y = document.documentElement.scrollTop || document.body.scrollTop || 0 + 200
        }
        return {
            'x': x,
            'y': y
        }
    } catch(e) {
        x = document.documentElement.scrollLeft || document.body.scrollLeft || 0 + 200;
        y = document.documentElement.scrollTop || document.body.scrollTop || 0 + 200;
        return {
            'x': x,
            'y': y
        }
    }
};
function imeMouseOverPage(a) {
    if (a == 0 && ime_getObj("ime_back").className == "ime_cloud_back2") {
        ime_getObj("ime_back").className = "ime_cloud_back3"
    } else if (a == 1 && ime_getObj("ime_forward").className == "ime_cloud_forward2") {
        ime_getObj("ime_forward").className = "ime_cloud_forward3"
    }
}
function imeMouseOutPage(a) {
    if (a == 0 && ime_getObj("ime_back").className == "ime_cloud_back3") {
        ime_getObj("ime_back").className = "ime_cloud_back2"
    } else if (a == 1 && ime_getObj("ime_forward").className == "ime_cloud_forward3") {
        ime_getObj("ime_forward").className = "ime_cloud_forward2"
    }
}
function imeGetPos(event) {
    try {
        if (ime_is_opera) {
            ime_x = event.clientX + window.pageXOffset;
            ime_y = event.clientY + window.pageYOffset
        } else if (ime_is_ie) {
            ime_x = window.event.clientX + document.documentElement.scrollLeft + document.body.scrollLeft;
            ime_y = window.event.clientY + document.documentElement.scrollTop + document.body.scrollTop
        } else {
            ime_x = event.clientX + window.scrollX;
            ime_y = event.clientY + window.scrollY
        }
    } catch(x) {}
    if (!ime_isInteger(ime_x)) ime_x = 200;
    if (!ime_isInteger(ime_y)) ime_y = 200
}
function ime_isInteger(s) {
    return (s.toString().search(/^-?[0-9]+$/) == 0)
}
function ime_moveobj(a) {
    ime_getObj(a).onmousedown = function(e) {
        drag_ = true;
        ime_scrollTop = document.documentElement.scrollTop || document.body.scrollTop || 0;
        with(this) {
            if (ime_is_ie) setCapture();
            if (ime_is_safari) {
                document.onselectstart = function() {
                    return false
                }
            }
            if (style.position == "fixed") {
                style.position = "absolute";
                if (a == "ime_status") style.top = parseInt(style.top.replace("px", "")) + ime_scrollTop + "px"
            }
            if (!ime_is_ie6) {
                ime_getObj(a).style.cursor = "move"
            }
            temp1 = offsetLeft;
            temp2 = offsetTop;
            if (ime_is_ie) {
                x = event.clientX;
                y = event.clientY;
                document.onmousemove = function(e) {
                    if (drag_ == false) return false;
                    with(this) {
                        if (temp1 + event.clientX - x < 0) style.left = "0px";
                        else if (document.documentElement.clientWidth && document.documentElement.clientWidth - temp1 - event.clientX + x < 160) style.left = document.documentElement.clientWidth - 160 + "px";
                        else style.left = temp1 + event.clientX - x + "px";
                        if (temp2 + event.clientY - y - ime_scrollTop < 0) style.top = ime_scrollTop + "px";
                        else if (document.documentElement.clientHeight && document.documentElement.clientHeight + ime_scrollTop - temp2 - event.clientY + y < 50) style.top = document.documentElement.clientHeight + ime_scrollTop - 50 + "px";
                        else style.top = temp2 + event.clientY - y + "px";
                        return false
                    }
                }
            } else {
                x = e.pageX;
                y = e.pageY;
                document.onmousemove = function(e) {
                    if (drag_ == false) return false;
                    with(this) {
                        if (temp1 + e.pageX - x < 0) style.left = "0px";
                        else if (document.documentElement.clientWidth && document.documentElement.clientWidth - temp1 - e.pageX + x < 160) style.left = document.documentElement.clientWidth - 160 + "px";
                        else style.left = temp1 + e.pageX - x + "px";
                        if (temp2 + e.pageY - y < 0) style.top = "0px";
                        else style.top = temp2 + e.pageY - y + "px";
                        ime_getObj("ime_layer").focus();
                        ime_getObj("ime_layer").blur();
                        return false
                    }
                }
            }
            document.onmouseup = function(e) {
                drag_ = false;
                with(this) {
                    if (ime_is_ie) {
                        releaseCapture();
                        document.onmousemove = null
                    }
                    if (ime_is_safari) document.onselectstart = null;
                    ime_scrollTop = document.documentElement.scrollTop || document.body.scrollTop || 0;
                    if (!ime_is_ie6 && ime_compatMode) {
                        ime_getObj(a).style.cursor = "default";
                        if (style.position == "absolute" && a == "ime_status" && ime_compatMode) style.top = parseInt(style.top.replace("px", "")) - ime_scrollTop + "px";
                        if (a == "ime_status" && ime_compatMode) style.position = "fixed"
                    } else style.position = "absolute";
                    if ((ime_is_ie6 || !ime_compatMode) && a == "ime_status") ime_ie6_status_top = parseInt((ime_getObj(a).style.top.replace("px", "")) - ime_scrollTop);
                    if (!ime_is_ie6 && !ime_compatMode) ime_getObj(a).style.cursor = "default"
                }
            }
        }
    }
}
function focusChange(n) {
    try {
        ime_getObj("ime_item_1").style.color = "#0082e5";
        ime_getObj("ime_item_2").style.color = "#0082e5";
        ime_getObj("ime_item_3").style.color = "#0082e5";
        ime_getObj("ime_item_4").style.color = "#0082e5";
        ime_getObj("ime_item_5").style.color = "#0082e5";
        ime_getObj("ime_item_" + n).style.color = "#f00"
    } catch(e) {}
}
function imeGetCurSor(a) {
    var b = a.value != undefined ? a.value: a.innerHTML;
    var c = 0;
    if (a.selectionStart != undefined) {
        c = a.selectionStart + "|" + a.selectionEnd
    } else {
        var d;
        if (a.tagName == "TEXTAREA") {
            var e = a.ownerDocument.selection.createRange();
            var f = a.ownerDocument.body.createTextRange();
            f.moveToElementText(a);
            for (var g = 0; f.compareEndPoints("StartToStart", e) < 0; g++) {
                f.moveStart('character', 1)
            }
            for (var i = 0; i <= g; i++) {
                if (b.charAt(i) == '\n') g++
            }
            var f = a.ownerDocument.body.createTextRange();
            f.moveToElementText(a);
            for (var j = 0; f.compareEndPoints('StartToEnd', e) < 0; j++) {
                f.moveStart('character', 1)
            }
            for (var i = 0; i <= j; i++) {
                if (b.charAt(i) == '\n') j++
            }
            return g + "|" + j
        } else {
            d = document.selection.createRange()
        }
        d.moveStart("character", -b.length);
        c = d.text.length;
        c = c + "|" + c
    }
    return c
}
function movePoint(a, n) {
    if (a.selectionStart != undefined) {
        a.selectionStart = n;
        a.selectionEnd = n
    } else {
        var b = parseInt(n);
        if (isNaN(b)) return;
        var c = a.createTextRange();
        var d = 0;
        for (var i = 0; i <= b; i++) {
            if (c.text.charAt(i) == '\n') d++
        }
        b -= d;
        c.moveStart("character", b);
        c.collapse(true);
        c.select()
    }
}
function getModeInput(a, b) {
    if (ime_mode_ZH) {
        if (ime_mode_BJ) {
            if (ime_mode_BD) {
                return b ? keyArr[a][5] : keyArr[a][2]
            } else return b ? keyArr[a][3] : keyArr[a][0]
        } else if (ime_mode_BD) return b ? keyArr[a][5] : keyArr[a][2];
        else return b ? keyArr[a][4] : keyArr[a][1]
    } else {
        if (ime_mode_BJ) {
            return b ? keyArr[a][3] : keyArr[a][0]
        } else {
            return b ? keyArr[a][4] : keyArr[a][1]
        }
    }
}
function imeClose() {
    ime_close = ime_close == 1 ? 0 : 1;
    ime_getObj("ime_layer").style.display = "none";
    ime_getObj("ime_query").innerHTML = "";
    ime_getObj("ime_res").innerHTML = "";
    query = "";
    ime_query_input = "";
    ime_part_key = new Array;
    word = new Array;
    var a = document.documentElement.scrollTop || document.body.scrollTop || 0;
    var b = window.top.window.innerWidth ? window.top.window.innerWidth: document.documentElement.clientWidth || document.body.clientWidth;
    var c = window.top.window.innerHeight ? window.top.window.innerHeight: document.documentElement.clientHeight || document.body.clientHeight;
    if (c < 62) c = 82;
    ime_getObj("ime_status").style.left = (b - 156) + "px";
    ime_getObj("ime_status").style.top = (ime_is_ie6 || !ime_compatMode) ? (a + c - 62) + "px": (c - 62) + "px";
    ime_getObj("ime_status").style.display = ime_close == 0 ? "": "none"
}
function imeToSBC(a, b) {
    var i;
    var c = '';
    for (i = 0; i < a.length; i++) {
        str1 = a.charCodeAt(i);
        if (str1 < 65296) {
            c += String.fromCharCode(a.charCodeAt(i));
            continue
        }
        if (str1 < 125 && !b) c += String.fromCharCode(a.charCodeAt(i));
        else c += String.fromCharCode(a.charCodeAt(i) - 65248)
    }
    return c
}
function imeToDBC(a) {
    var b = "";
    for (var i = 0; i < a.length; i++) {
        if (a.charCodeAt(i) == 32) {
            b = b + String.fromCharCode(12288)
        } else if ((a.charCodeAt(i) == 96) || (a.charCodeAt(i) == 126) || (a.charCodeAt(i) == 64) || (a.charCodeAt(i) == 35) || (a.charCodeAt(i) == 37) || (a.charCodeAt(i) == 38) || (a.charCodeAt(i) == 42)) {
            b = b + String.fromCharCode(a.charCodeAt(i) + 65248)
        } else if (a.charCodeAt(i) < 127) {
            b = b + String.fromCharCode(a.charCodeAt(i) + 65248)
        } else b += a.substr(i, 1)
    }
    return b
}
if (typeof(ime_close) == "undefined") {
    var ime_is_opera = 0;
    var ime_is_ie = 0;
    var ime_is_ie6 = 0;
    var ime_is_safari = 0;
    var ime_is_maxthon1 = 0;
    var ime_agent_modify = 0;
    var x, y;
    var layer_x = 0;
    var layer_y = 0;
    var old_x = 0;
    var old_y = 0;
    var drag_ = false;
    var keyArr = new Array;
    var query = "";
    var layer_pos = 0;
    var word = new Array();
    var tab_len = 334;
    var focus_id = 1;
    var ime_settime = -1;
    var ime_request_settime = -1;
    var ime_query_key = -1;
    var ime_query_res = -1;
    var ime_part_key = new Array();
    var ime_query_input = "";
    var ime_settime_page = -1;
    var ime_query_page = 1;
    var ime_query_page_max = 1;
    var ime_only_shift = 0;
    var ime_mode_ZH = 1;
    var ime_mode_BJ = 1;
    var ime_mode_BD = 1;
    var ime_close = 0;
    var ime_cur_input_obj;
    var ime_opera_allow_press = 0;
    var ime_fn_allow = 0;
    var ime_cur_rng;
    var ime_cur_cursor = 0;
    var ime_ie6_status_top = document.documentElement.clientHeight - 62;
    var ime_single_quote = 0;
    var ime_double_quote = 0;
    var ime_scrollTop = 0;
    var ime_iframe_arr = new Array;
    var ime_compatMode = 0;
    var ime_pingback_keyup = 0;
    var ime_pingback_showres = 0;
    var ime_request_on = 1;
    var ime_request_waiting = "";
    var ime_rebind_flag = true,
    ime_rebind_num = 0;
    var ime_detect = true;
    var ime_MacKey = 0;
    var ime_patch_key = "dfGgDFhrC4B34";
    var ime_hosturl = "http://web.pinyin.sogou.com/web_ime/";
    keyArr[48] = Array("0", "0", "０", ")", ")", "）");
    keyArr[49] = Array("1", "1", "１", "!", "!", "！");
    keyArr[50] = Array("2", "2", "２", "@", "@", "@");
    keyArr[51] = Array("3", "3", "３", "#", "#", "#");
    keyArr[52] = Array("4", "4", "４", "$", "$", "￥");
    keyArr[53] = Array("5", "5", "５", "%", "%", "％");
    keyArr[54] = Array("6", "6", "６", "^", "^", "……");
    keyArr[55] = Array("7", "7", "７", "&", "&", "&");
    keyArr[56] = Array("8", "8", "８", "*", "*", "*");
    keyArr[57] = Array("9", "9", "９", "(", "(", "（");
    keyArr[59] = Array(";", "；", "；", ":", "：", "：");
    keyArr[65] = Array("a", "ａ", "ａ", "A", "Ａ", "Ａ");
    keyArr[66] = Array("b", "ｂ", "ｂ", "B", "Ｂ", "Ｂ");
    keyArr[67] = Array("c", "ｃ", "ｃ", "C", "Ｃ", "Ｃ");
    keyArr[68] = Array("d", "ｄ", "ｄ", "D", "Ｄ", "Ｄ");
    keyArr[69] = Array("e", "ｅ", "ｅ", "E", "Ｅ", "Ｅ");
    keyArr[70] = Array("f", "ｆ", "ｆ", "F", "Ｆ", "Ｆ");
    keyArr[71] = Array("g", "ｇ", "ｇ", "G", "Ｇ", "Ｇ");
    keyArr[72] = Array("h", "ｈ", "ｈ", "H", "Ｈ", "Ｈ");
    keyArr[73] = Array("i", "ｉ", "ｉ", "I", "Ｉ", "Ｉ");
    keyArr[74] = Array("j", "ｊ", "ｊ", "J", "Ｊ", "Ｊ");
    keyArr[75] = Array("k", "ｋ", "ｋ", "K", "Ｋ", "Ｋ");
    keyArr[76] = Array("l", "ｌ", "ｌ", "L", "Ｌ", "Ｌ");
    keyArr[77] = Array("m", "ｍ", "ｍ", "M", "Ｍ", "Ｍ");
    keyArr[78] = Array("n", "ｎ", "ｎ", "N", "Ｎ", "Ｎ");
    keyArr[79] = Array("o", "ｏ", "ｏ", "O", "Ｏ", "Ｏ");
    keyArr[80] = Array("p", "ｐ", "ｐ", "P", "Ｐ", "Ｐ");
    keyArr[81] = Array("q", "ｑ", "ｑ", "Q", "Ｑ", "Ｑ");
    keyArr[82] = Array("r", "ｒ", "ｒ", "R", "Ｒ", "Ｒ");
    keyArr[83] = Array("s", "ｓ", "ｓ", "S", "Ｓ", "Ｓ");
    keyArr[84] = Array("t", "ｔ", "ｔ", "T", "Ｔ", "Ｔ");
    keyArr[85] = Array("u", "ｕ", "ｕ", "U", "Ｕ", "Ｕ");
    keyArr[86] = Array("v", "ｖ", "ｖ", "V", "Ｖ", "Ｖ");
    keyArr[87] = Array("w", "ｗ", "ｗ", "W", "Ｗ", "Ｗ");
    keyArr[88] = Array("x", "ｘ", "ｘ", "X", "Ｘ", "Ｘ");
    keyArr[89] = Array("y", "ｙ", "ｙ", "Y", "Ｙ", "Ｙ");
    keyArr[90] = Array("z", "ｚ", "ｚ", "Z", "Ｚ", "Ｚ");
    keyArr[96] = Array("0", "0", "０", ")", ")", "）");
    keyArr[97] = Array("1", "1", "１", "!", "!", "！");
    keyArr[98] = Array("2", "2", "２", "@", "@", "@");
    keyArr[99] = Array("3", "3", "３", "#", "#", "#");
    keyArr[100] = Array("4", "4", "４", "$", "$", "￥");
    keyArr[101] = Array("5", "5", "５", "%", "%", "％");
    keyArr[102] = Array("6", "6", "６", "^", "^", "……");
    keyArr[103] = Array("7", "7", "７", "&", "&", "&");
    keyArr[104] = Array("8", "8", "８", "*", "*", "*");
    keyArr[105] = Array("9", "9", "９", "(", "(", "（");
    keyArr[106] = Array("*", "＊", "*", "*", "＊", "*");
    keyArr[107] = Array("=", "＝", "=", "+", "＋", "+");
    keyArr[187] = Array("=", "＝", "=", "+", "＋", "+");
    keyArr[109] = Array("-", "－", "-", "_", "＿", "——");
    keyArr[189] = Array("-", "－", "-", "_", "＿", "——");
    keyArr[110] = Array(".", "．", ".", ".", "．", ".");
    keyArr[111] = Array("/", "／", "/", "/", "／", "/");
    keyArr[186] = Array(";", "；", "；", ":", "：", "：");
    keyArr[188] = Array(",", "，", "，", "<", "＜", "《");
    keyArr[190] = Array(".", "．", "。", "& gt;", "＞", "》");
    keyArr[191] = Array("/", "／", "、", "?", "？", "？");
    keyArr[192] = Array("`", "｀", "·", "~", "～", "～");
    keyArr[219] = Array("[", "［", "【", "{", "｛", "{");
    keyArr[220] = Array("\\", "＼", "、", "|", "｜", "|");
    keyArr[221] = Array("]", "］", "】", "}", "｝", "}");
    keyArr[222] = Array("'", "'", "‘", "’", " \"", "＂", "“", "”");
    imeInit()
} else if (ime_close == 1) imeClose();